/****************************************************************************
   Copyright 2013 Stacy Doss

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
****************************************************************************/

#include "DefPin.h"

#include <iostream>
#include <stdio.h>


//// ************************************************************************
namespace def {
	Pin::Pin() {
		_use = util::UNUSED;
		_direction = util::NODIRECTION;
		_layerRect = new util::Rect();
		_placement = util::UNPLACED;
		_origin = NULL;
	};


	Pin::Pin(std::string name) {
		_name = name;
		_use = util::UNUSED;
		_direction = util::NODIRECTION;
		_layerRect = new util::Rect();
		_placement = util::UNPLACED;
		_origin = NULL;
	};


	Pin::Pin(std::string name, std::string net) {
		_name = name;
		_net  = net;
		_use = util::UNUSED;
		_direction = util::NODIRECTION;
		_layerRect = new util::Rect();
		_placement = util::UNPLACED;
		_origin = NULL;
	};


	Pin::~Pin() {

	};


	std::string
	Pin::getName() {
		return _name;
	};

	std::string
	Pin::getNet() {
		return _net;
	};

	void
	Pin::setName(std::string name) {
		_name = name;
	};


	void
	Pin::setNet(std::string net) {
		_net = net;
	};


	void
	Pin::setDirection(util::DIRECTION_TYPE direction) {
		_direction = direction;
	};


	void
	Pin::setUse(util::USE_TYPE use) {
		_use = use;
	};

	void
	Pin::setLayer(std::string layerName, util::Point* origin, util::Point* extent) {
		_layerName = layerName;
		_layerRect->setOrigin(origin);
		_layerRect->setExtent(extent);
	};

	void
	Pin::setPlacement(util::PLACEMENT_TYPE placement) {
		_placement = placement;
	};


	void
	Pin::setOrigin(util::Point* origin) {
		_origin = origin;
	};


	void
	Pin::setOrient(std::string orient) {
		_orient = orient;
	};




};
